import { axios } from "@/utils/request";
import { baseUrl } from "@/services/baseUrl";

//视频管理-树节点
export function getNodeList(data) {
  return axios({
    url: baseUrl + "/probusiness/zhgdVideoNode/getNodeList",
    method: "POST",
    headers: {
      "Content-Type": "application/json;charset=UTF-8",
    },
    data,
  });
}

//视频管理-节点-删除
export function deleteNode(id) {
  return axios({
    url: baseUrl + `/probusiness/zhgdVideoNode/deleteBatch?uuids=${id}`,
    method: "POST",
    headers: {
      "Content-Type": "application/json;charset=UTF-8",
    },
  });
}

//视频管理-视频-删除
export function deleteVideo(id) {
  return axios({
    url: baseUrl + `/probusiness/zhgdVideo/deleteBatch?uuids=${id}`,
    method: "POST",
    headers: {
      "Content-Type": "application/json;charset=UTF-8",
    },
  });
}

//视频管理-节点-新增
export function saveNode(data) {
  return axios({
    url: baseUrl + `/probusiness/zhgdVideoNode/save`,
    method: "POST",
    headers: {
      "Content-Type": "application/json;charset=UTF-8",
    },
    data,
  });
}

//视频管理-视频-新增
export function saveVideo(data) {
  return axios({
    url: baseUrl + `/probusiness/zhgdVideo/save`,
    method: "POST",
    headers: {
      "Content-Type": "application/json;charset=UTF-8",
    },
    data,
  });
}
//视频管理-节点-编辑
export function updateNode(data) {
  return axios({
    url: baseUrl + `/probusiness/zhgdVideoNode/update`,
    method: "POST",
    headers: {
      "Content-Type": "application/json;charset=UTF-8",
    },
    data,
  });
}

//视频管理-视频-编辑
export function updateVideo(data) {
  return axios({
    url: baseUrl + `/probusiness/zhgdVideo/update`,
    method: "POST",
    headers: {
      "Content-Type": "application/json;charset=UTF-8",
    },
    data,
  });
}
//视频管理-节点-详情
export function detailNode(uuid) {
  return axios({
    url: baseUrl + `/probusiness/zhgdVideoNode/getDetailByUuid?uuid=${uuid}`,
    method: "POST",
    headers: {
      "Content-Type": "application/json;charset=UTF-8",
    },
  });
}
//视频管理-视频-详情
export function detailVideo(uuid) {
  return axios({
    url: baseUrl + `/probusiness/zhgdVideo/getDetailByUuid?uuid=${uuid}`,
    method: "POST",
    headers: {
      "Content-Type": "application/json;charset=UTF-8",
    },
  });
}
//视频管理-控制高清/流畅
export function setProjectVideo(data) {
  return axios({
    url: baseUrl + `/probusiness/zhgdVideo/setProjectVideo`,
    method: "POST",
    headers: {
      "Content-Type": "application/json;charset=UTF-8",
    },
    data,
  });
}
//视频管理-流畅/高清-超管权限
export function getProjectVideoConfig(data) {
  return axios({
    url: baseUrl + `/probusiness/zhgdVideo/getProjectVideoConfig`,
    method: "POST",
    headers: {
      "Content-Type": "application/json;charset=UTF-8",
    },
    data,
  });
}
//视频管理-旋转角度权限
export function getAdjustAngle(data) {
  return axios({
    url: baseUrl + `/probusiness/zhgdVideo/getAdjustAngle`,
    method: "POST",
    headers: {
      "Content-Type": "application/json;charset=UTF-8",
    },
    data,
  });
}

//视频管理-设置视频预置位
export function setVideoIntdata(params) {
  return axios({
    url: baseUrl + `/probusiness/zhgdVideo/updateIntdata`,
    method: "POST",
    params,
  });
}

// 人员组织
export function getTreeSysOrganizationByPid(data) {
  let { proCode } = data;
  return axios({
    url:
      baseUrl +
      `/probusiness/zhgdUser/getTreeSysOrganizationByPid?proCode=${proCode}`,
    method: "POST",
    headers: {
      "Content-Type": "application/json;charset=UTF-8",
    },
    data: {},
  });
}
// 人员组织-列表
export function pageUserOrganization(data) {
  let { page, pageSize, org_code, userName } = data;
  return axios({
    url:
      baseUrl +
      `/probusiness/zhgdUser/getPageSet?pageNo=${page}&pageSize=${pageSize}&order=desc&sort=createTime&orgCode=${org_code}&userName=${userName}`,
    method: "POST",
    headers: {
      "Content-Type": "application/json;charset=UTF-8",
    },
  });
}

// 人员组织-新增
export function saveUserOrganization(data) {
  return axios({
    url: baseUrl + `/probusiness/zhgdUser/save`,
    method: "POST",
    headers: {
      "Content-Type": "application/json;charset=UTF-8",
    },
    data,
  });
}
// 人员组织-编辑
export function updateUserOrganization(data) {
  return axios({
    url: baseUrl + `/probusiness/zhgdUser/update`,
    method: "POST",
    headers: {
      "Content-Type": "application/json;charset=UTF-8",
    },
    data,
  });
}
// 人员组织-详情
export function detailUserOrganization(uuid) {
  return axios({
    url: baseUrl + `/probusiness/zhgdUser/getDetailByUuid?varchar=${uuid}`,
    method: "POST",
    headers: {
      "Content-Type": "application/json;charset=UTF-8",
    },
  });
}
// 人员组织-删除
export function deleteUserOrganization(id) {
  return axios({
    url: baseUrl + `/probusiness/zhgdUser/deleteBatch?varchar=${id}`,
    method: "POST",
    headers: {
      "Content-Type": "application/json;charset=UTF-8",
    },
  });
}

//人员档案-下载模版
export function peopleFilesTemplate(params = {}) {
  return axios({
    url: baseUrl + `/probusiness/zhgdUser/downloadUserTemplate`,
    method: "GET",
    apiType: "file",
    responseType: "arraybuffer",
    params,
  });
}
//人员档案-批量导入
export function importPeopleFiles(file) {
  return axios({
    url: baseUrl + `/probusiness/zhgdUser/importUserExcel`,
    method: "POST",
    headers: {
      "Content-Type": "multipart/form-data",
    },
    data: file,
  });
}
